<%@ page import="sun.net.smtp.SmtpClient, java.io.*" %>
<%
 String from="singh.roshan08@gmail.com";
 String to="singh.roshan08@gmail.com, roshan@yahoo.com";
 try{
     SmtpClient client = new SmtpClient("localhost");
     client.from(from);
     client.to(to);
     PrintStream message = client.startMessage();
     message.println("To: " + to);
     message.println("Subject:  Sending email from JSP!");
     message.println("This was sent from a JSP page!");
     message.println();
     message.println("Cool beans! :-)");
     message.println();     
     message.println();
     client.closeServer();
  }
  catch (IOException e){	
     System.out.println("ERROR SENDING EMAIL:"+e);
  }
%>
